/*
 * @Author: xiaoyan
 * @Date: 2021-09-22 17:15:37
 * @LastEditors: xiaoyan
 * @LastEditTime: 2021-09-29 14:42:50
 * @Description: 
 * @FilePath: \vue3-ts-demo\src\api\user.ts
 */
import { RequestParams, ContentType, Method } from 'axios-mapper'
import https from '@/utils/https'
import { RootObject } from '@/model/rootObject'
import { LoginModel, UserInfoModel } from '@/model/userModel'
const userApi = (window as any).conf.userApi + '/api/auth/v1';
export const login = (userInfo: RequestParams)=>{
    return https.request<RootObject<LoginModel>>(`${userApi}/login`, Method.POST, userInfo, ContentType.json)
}

export const getUuidkey = () => {
    return https.request<RootObject<UserInfoModel>>(`${userApi}/login-verification/get-uuidkey`, Method.GET, undefined, ContentType.json)
}

export const userCurrentInfo = () => {
    return https.request<RootObject<UserInfoModel>>(`${userApi}/user/currentInfo`, Method.GET, undefined, ContentType.json)
}